﻿<%@ Page Language="c#" CodeBehind="ListView.aspx.cs" AutoEventWireup="false" Inherits="UDS.SubModule.Position.ListViewPage" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
  <title>ListView</title>
  <uds:Style runat="server" Href="~/css/BasicLayout.css" />
  <script language="javascript" type="text/javascript">
  //<!--
  function SelectItem() {
    var nodes = document.getElementsByTagName("input");
    for (var i = 0; i < nodes.length; i++) {
      var node = nodes[i];
      if (node.type === "checkbox") {
        node.checked = !node.checked
      }
    }
  }

  // 高亮背景
  function high(which) {
    which.style.background = "#C0D9E6";
    which.style.font.color = "red";
  }

  // 取消背景高亮
  function low(which) {
    which.style.background = "#FFFFFF";
    which.style.font.color = "black";
  }

  var ball1 = new Image();
  var ball2 = new Image();
  ball1.src = 'images/ball1.gif';
  ball2.src = 'images/ball2.gif';

  var active = new Image();
  var nonactive = new Image();
  active.src = '../../images/maillistbutton2.gif';
  nonactive.src = '../../images/maillistbutton1.gif';

  function onMouseOver(img) {
    document.images[img].src = ball2.src;
  }

  function onMouseOut(img) {
    document.images[img].src = ball1.src;
  }

  function onOverBar(bar) {
    if (bar != null) {
      bar.style.backgroundImage = "url(" + active.src + ")";
    }
  }

  function onOutBar(bar) {
    if (bar != null) {
      bar.style.backgroundImage = "url(" + nonactive.src + ")";
    }
  }

  function selectAll() {
    var len = document.MailList.elements.length;
    var i;
    for (i = 0; i < len; i++) {
      if (document.MailList.elements[i].type == "checkbox") {
        document.MailList.elements[i].checked = true;
      }
    }
  }

  function unSelectAll() {
    var len = document.MailList.elements.length;
    var i;
    for (i = 0; i < len; i++) {
      if (document.MailList.elements[i].type == "checkbox") {
        document.MailList.elements[i].checked = false;
      }
    }
  }
  //-->
  </script>
</head>
<body>
  <form id="ListView" runat="server">
    <table cellspacing="0" cellpadding="0" width="100%" border="0">
      <tr>
        <td>
          <table cellspacing="0" cellpadding="0" width="100%" border="0">
            <tr>
              <td class="<%= ShowNormalStaffs ? "selectedTab" : "unSelectedTab" %>"><a href="Listview.aspx?PositionID=<%= PositionID %>&DisplayType=0" class="Newbutton">在职员工</a> </td>
              <td class="<%= !ShowNormalStaffs ? "selectedTab" : "unSelectedTab" %>"><a href="Listview.aspx?PositionID=<%= PositionID %>&DisplayType=1" class="Newbutton">离职员工</a> </td>
              <td align="right">
                <asp:CheckBox ID="cbRemind" runat="server" Font-Size="X-Small" Text="提醒公司全体员工" Width="160px" Height="16px" />
                <input type="button" class="redbuttoncss" value="修改职级" onclick="window.location.href = 'UpdateCaste.aspx?PositionID=<%= PositionID %>';" />
                <input type="button" class="redbuttoncss" value="新员工" onclick="window.location.href = 'NewStaff.aspx?PositionID=<%= PositionID %>&DisplayType=<%= (int)PageDisplayType.Add %>';" />
                <input type="button" class="redbuttoncss" value="职位操作" onclick="window.location.href = 'OPosition.aspx?PositionID=<%= PositionID %>';" />
                <input type="button" class="redbuttoncss" value="权限管理" onclick="window.location.href = '../AssignRule/RightListview.aspx?ObjID=<%= PositionID %>&DisplayType=<%= (int)EntityType.Position %>';" />
                <asp:Button ID="cmdOnPosition" runat="server" Text="复职" CssClass="redbuttoncss" />
                <asp:Button ID="cmdOffPosition" runat="server" Text="离职" CssClass="redbuttoncss" />
                <asp:Button ID="cmdChangePosition" runat="server" Text="调职" CssClass="redbuttoncss" />
              </td>
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td>
          <uds:UDSDataGrid ID="dbStaffList" runat="server" DataKeyField="ID" OnPageIndexChanged="DataGrid_PageChanged">
            <Columns>
              <asp:TemplateColumn HeaderText="ID">
                <HeaderStyle Width="20px" />
                <ItemTemplate>
                  <asp:CheckBox ID="Staff_ID" runat="server" />
                </ItemTemplate>
              </asp:TemplateColumn>
              <asp:HyperLinkColumn Text="真实姓名" DataNavigateUrlField="ID" DataNavigateUrlFormatString="../Position/NewStaff.aspx?StaffID={0}&amp;ReturnPage=0" DataTextField="RealName" HeaderText="真实姓名">
                <HeaderStyle Width="100px" />
              </asp:HyperLinkColumn>
              <asp:BoundColumn DataField="Mobile" HeaderText="手机">
                <HeaderStyle Width="60px" />
              </asp:BoundColumn>
              <asp:BoundColumn DataField="AgeStr" HeaderText="年龄">
                <HeaderStyle HorizontalAlign="Center" Width="30px"></HeaderStyle>
                <ItemStyle HorizontalAlign="Center"></ItemStyle>
              </asp:BoundColumn>
              <asp:BoundColumn DataField="SexStr" HeaderText="性别">
                <HeaderStyle HorizontalAlign="Center" Width="30px"></HeaderStyle>
                <ItemStyle HorizontalAlign="Center"></ItemStyle>
              </asp:BoundColumn>
              <asp:BoundColumn DataField="Email" HeaderText="Email">
                <HeaderStyle Width="100px"></HeaderStyle>
              </asp:BoundColumn>
              <asp:BoundColumn DataField="PositionName" HeaderText="所在职位">
                <HeaderStyle Width="150px"></HeaderStyle>
              </asp:BoundColumn>
              <asp:TemplateColumn HeaderText="注册日期">
                <ItemTemplate>
                  <%# Utility.FormatDate( ((StaffInfo)Container.DataItem).TimeRegistered ) %>
                </ItemTemplate>
              </asp:TemplateColumn>
            </Columns>
          </uds:UDSDataGrid>
        </td>
      </tr>
    </table>
  </form>
</body>
</html>
